<template>
  <div>
    <el-scrollbar>
      <el-aside width="200px">
        <el-menu
          background-color="#545c64"
          text-color="#fff"
          class="el-menu-demo"
          active-text-color="#ffd04b"
          default-active="/"
          @select="handleSelect">
          <!-- :default-active="$route.path"  -->
          <!-- router -->
          <!-- <template v-for="item in $router.options.routes">
            <el-menu-item v-if="!item.children && item.name != '登录页'" :index="item.path" :key="item.path" >
              {{item.name}}
            </el-menu-item>
            <el-menu-item v-else-if="item.name == '首页'" :index="item.redirect" :key="item.redirect" >
              {{item.name}}
            </el-menu-item>
            <el-submenu v-else-if="item.name != '登录页'" :index="item.path" :key="item.path">
              <template slot="title">{{ item.name }}</template>
              <el-menu-item v-for="child in item.children" :index="item.path + '/' + child.path" :key="item.path + '/' + child.path">{{ child.name }}</el-menu-item>
            </el-submenu>
          </template> -->


          <!-- <template v-for="item in menuList">
            <el-menu-item :index="item.url" :key="item.url" >
              {{item.name}}
            </el-menu-item>
          </template> -->
          <template>
            <el-menu-item index="/org">
              <template slot="title">
                <span slot="title">组织架构</span>
              </template>
            </el-menu-item>
             <el-menu-item index="/position">
              <span slot="title">部门职位</span>
            </el-menu-item>
            <el-menu-item index="/user">
              <span slot="title">用户管理</span>
            </el-menu-item>
            <el-menu-item index="/role">
              <span slot="title">角色管理</span>
            </el-menu-item>
            <el-menu-item index="/resources">
              <span slot="title">菜单管理</span>
            </el-menu-item>
            <el-menu-item index="/workflow">
              <span slot="title">流程管理</span>
            </el-menu-item>
            <el-submenu index="/form">
              <span slot="title">表单管理</span>
              <!-- <el-menu-item index="/formBuild">表单设计</el-menu-item> -->
              <el-menu-item index="/formList">表单列表</el-menu-item>
            </el-submenu>
            <!--  <el-menu-item index="/monitor">
                <span slot="title">流程监控</span>
              </el-menu-item> -->
              <el-submenu index="8">
                  <span slot="title">数据字典</span>
                  <el-menu-item index="/dict">系统字典</el-menu-item>
                  <!-- <el-menu-item index="500">设备字典</el-menu-item> -->
                <el-menu-item index="/boardroom">会议室字典</el-menu-item>
                <el-menu-item index="/folder">知识库字典</el-menu-item>
                <el-menu-item index="/setting">安全设置</el-menu-item>
              </el-submenu>
          </template>
        </el-menu>
      </el-aside>
    </el-scrollbar>
  </div>
</template>
<script>
  export default {

    props: [ 'menuList' ],

    data () {
      return {

      }
    },
    methods:{
      handleSelect(key){
        console.log(key);
        this.$router.replace(key);
      }
    }
  }
</script>
<style scoped lang="scss">
.el-menu{
  border-right: none;
}
.el-scrollbar{
  height: 100%;
  background-color: #545c64;
}
</style>
